package ferp.android.layouts;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

/**
 * User: igorgok
 * Date: 4/29/13 6:41 PM
 */
public class SquareLayout extends LinearLayout
{
  public SquareLayout(Context context)
  {
    super(context);
  }

  public SquareLayout(Context context, AttributeSet attrs)
  {
    super(context, attrs);
  }

  @Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
  {
    int min = Math.min(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));

    super.onMeasure(MeasureSpec.getMode(widthMeasureSpec) | min, MeasureSpec.getMode(heightMeasureSpec) | min);
  }
}
